import request from '@/utils/request';
import type { LoginDTO } from '@/types/user';
import type { UserInfoDTO } from '@/types/user';

interface loginVO {
  username: string;
  password: string;
  captcha: string;
}

export const authApi = {
  login: (data:loginVO): Promise<LoginDTO> => request.post({ url: '/auth/login', data }),
  getUserInfo: (id?: string): Promise<UserInfoDTO> => {
    console.log('getUserInfo', id);
    
    return request.get({ url: '/user/detail', params: { id } });
  },
}